package nettyhttpserver;
import java.util.Properties;
public class Server {
	public static void main(String[] args) throws Exception {
		Properties pp = Config.getInstance();
		String start = pp.getProperty("start");
		if (start.equals("http")) {
			Integer httpport = Integer.valueOf(pp.getProperty("http"));
			// System.out.println("端口"+port);
			if (httpport == null)
				httpport = 8080;
			HttpServer.start(httpport);
		} else if (start.equals("ssl")) {
			Integer sslport = Integer.valueOf(pp.getProperty("ssl"));
			// System.out.println("端口"+port);
			if (sslport == null)
				sslport = 443;
		} else if (start.equals("ws")) {
			Integer wsport = Integer.valueOf(pp.getProperty("ws"));
			// System.out.println("端口"+port);
			if (wsport == null)
				wsport = 222;
			WebSocketServer.start(wsport);
		} else if (start.equals("socket")) {
			Integer socketport = Integer.valueOf(pp.getProperty("socket"));
			// System.out.println("端口"+socketport);
			if (socketport == null)
				socketport = 999;
			SockerServer.start(socketport);
		}
	}
}
